package se.tinkerway.bomberman.domain.tile;

import se.tinkerway.bomberman.domain.TileCallback;
import se.tinkerway.bomberman.view.Appearance;
import se.tinkerway.bomberman.view.Frame;

public class DestructableWall extends Wall {
	
	private int hp;
	private double maxHp;

	public DestructableWall(int hp) {
		this.hp = hp;
		this.maxHp = hp;
	}

	@Override
	public boolean burn(TileCallback callback) {
		hp--;
		if (hp == 0) {
			callback.remove();
		}
		return false;
	}

	@Override
	public Frame getFrame() {
		return new Frame(hp / maxHp, Appearance.WALL);
	}

}
